<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<!-- 修改商品页面 -->
<?php
//判断是否非法访问
session_start();
if (!isset($_SESSION['ADMININFOS'])) {
    echo "<script>alert('非法访问！');window.location.href='a_login.html';</script>";
    exit();
}
?>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="icon" href="../img/ICO.png">
    <title>古韵超市 · 管理员</title>
    <link rel="stylesheet" href="bootstrap-5.3.3-dist/bootstrap.min.css">
    <link rel="stylesheet" href="layui/css/layui.css">
    <link rel="stylesheet" href="css/public.css">
    <link rel="stylesheet" href="css/a_changegoods.css">
    <script src="js/changegoods.js"></script>
</head>

<body>
    <div class="layui-layout layui-layout-admin">
        <div class="layui-header">
            <div class="layui-logo layui-hide-xs layui-bg-black">
                <img src="img/LOGO-w.png" height="100%">
            </div>
            <!-- 头部区域（可配合layui 已有的水平导航） -->
            <ul class="layui-nav layui-layout-left">
                <b class="layui-nav-item layui-show-xs-inline-block">
                    <i class="layui-icon layui-icon-date"></i> 日期：<span id="nowTime"></span> |
                    <i class="layui-icon layui-icon-time"></i> 时间：<span id="timeDisplay"></span>
                </b>
            </ul>
            <ul class="layui-nav layui-layout-right">
                <li class="layui-nav-item layui-hide layui-show-sm-inline-block">
                    <a href="javascript:;">
                        <i class="layui-icon layui-icon-friends"> 登录管理员：</i>
                        <?php echo $_SESSION['ADMININFOS']['aname'] ?>
                        <span> | </span><span id="welcome"></span>
                    </a>
                </li>
                <li class="layui-nav-item" lay-header-event="menuRight" lay-unselect>
                    <a href="php/logout.php">
                        <i class="layui-icon layui-icon-return" title="退出登录"></i>
                    </a>
                </li>
            </ul>
        </div>
        <div class="layui-side layui-bg-black">
            <div class="layui-side-scroll">
                <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
                <ul class="layui-nav layui-nav-tree" lay-filter="test">
                    <li class="layui-nav-item">
                        <a href="javascript:;">系统面板</a>
                        <dl class="layui-nav-child">
                            <dd><a href="a-main.php">信息统计面板</a></dd>
                        </dl>
                    </li>
                    <li class="layui-nav-item">
                        <a href="javascript:;">订单管理</a>
                        <dl class="layui-nav-child">
                            <dd><a href="a_deal_order.php">待发货订单</a></dd>
                            <dd><a href="a_ordered.php">已发货订单</a></dd>
                            <dd><a href="a_history_order.php">历史订单</a></dd>
                        </dl>
                    </li>
                    <li class="layui-nav-item">
                        <a href="javascript:;">用户管理</a>
                        <dl class="layui-nav-child">
                            <dd><a href="a_list_user.php">用户信息</a></dd>
                            <dd><a href="a_blocking_user.php">账户拉黑</a></dd>
                        </dl>
                    </li>
                    <li class="layui-nav-item layui-nav-itemed">
                        <a href="javascript:;">商品管理</a>
                        <dl class="layui-nav-child">
                            <dd><a href="a_list_goods.php">商品列表</a></dd>
                            <dd><a href="a_add_goods.php">添加商品</a></dd>
                            <dd><a href="a_outline_goods.php">下架商品</a></dd>
                            <dd class="layui-this"><a href="javascript:;">信息修改</a></dd>
                        </dl>
                    </li>
                    <li class="layui-nav-item">
                        <a href="javascript:;">评论管理</a>
                        <dl class="layui-nav-child">
                            <dd><a href="a_remark_goods.php">评论查看</a></dd>
                        </dl>
                    </li>
                </ul>
            </div>
        </div>
        <div class="layui-body">
            <!-- 内容主体区域 -->
            <div style="padding: 15px;">
                <blockquote class="layui-elem-quote layui-text">
                    管理员修改商品信息页面
                </blockquote>
                <div class="layui-card layui-panel">
                    <div class="layui-card-header">
                        您可以在此页面修改商品信息，包括设置商品名称、价格、库存、描述等，但是需要先进行检索。
                    </div>
                    <div class="layui-card-body">
                        <div class="row g-3 search-div">
                            <div class="col-sm-9">
                                <input type="text" class="form-control" id="inputSearch" placeholder="请输入完整商品ID">
                            </div>
                            <div class="col-sm-3">
                                <button type="button" class="btn btn-outline-primary"
                                    onclick="searchGoods()">查找商品</button>
                            </div>
                        </div>
                        <div class="change-goods-form" id="form-div">
                            <form action='php/change-goods.php' method='post'>
                                <div class='oldimg'><img src=''></div>
                                <div class='col-8'>
                                    <label for='goods_name' class='form-label'>商品名称</label>
                                    <input type='text' class='form-control' name='goods_name' id='goods_name'
                                        placeholder='输入商品名称' required>
                                </div>
                                <div class='col-4'>
                                    <label for='goods_num' class='form-label'>商品库存</label>
                                    <input type='number' class='form-control' name='goods_num' id='goods_num'
                                        placeholder='输入商品库存' required>
                                </div>
                                <div class='col-4'>
                                    <label for='goods_specs' class='form-label'>商品规格(Kg)</label>
                                    <input type='number' class='form-control' name='goods_specs' id='goods_specs'
                                        placeholder='输入商品规格(Kg)' required>
                                </div>
                                <div class='col-4'>
                                    <label for='goods_price' class='form-label'>商品单价(元)</label>
                                    <input type='text' class='form-control' name='goods_price' id='goods_price'
                                        placeholder='输入商品单价(元)' required>
                                </div>
                                <div class='col-12'>
                                    <label for='goods_describe' class='form-label'>商品描述</label>
                                    <textarea type='text' class='form-control describe' name='goods_describe'
                                        id='goods_describe' placeholder='输入商品描述' required></textarea>
                                </div>
                                <div class='col-12 btndiv'>
                                    <button type='submit' class='btn btn-primary'>提交</button>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
                <br><br>
            </div>
        </div>
        <div class="layui-footer">
            <!-- 底部固定区域 -->
            古韵超市管理系统© 2025® All Rights Reserved.
        </div>
    </div>
    <script src="layui/layui.js" charset="utf-8"></script>
    <script src="js/getDatetime.js"></script>
</body>

</html>